<!-- changeorder 页面内容 -->
<section class="changeorder" ng-controller="changeorderCtrl">
	<ol class="breadcrumb">
		<li ng-click="goBack();">
			<a ng-bind="isreview? '审核订单': '我的订单'"></a>
		</li>
		<li><a>修改</a></li>
	</ol>

	<div class="row margin-reset">
		<div class="panel yf-shadow">
			<div class="panel-heading">
				<div class="row margin-reset">
					<span class="pull-right">订单号：{{order.serial_number}}</span>
					<h4>订单编辑</h4>
				</div>
			</div>
			<div class="panel-body">
				<form class="form-horizontal">

					<div class="form-group" ng-if="handleLists.or.indexOf(user.user_type) != -1">
						<label for="total" class="control-label">订单总金额</label>
						<input type="text" class="form-control" id="total123fd" input-format ng-pattern="/^\d+(\.\d{0,2})?$/" autocomplete="false" placeholder="请输入订单总金额" ng-model="order.sale_amount">
					</div>

					<div class="form-group">
						<label for="square" class="control-label">窗体的面积(㎡)</label>
						<input type="number" class="form-control" id="square" placeholder="请输入窗体的面积(㎡)" ng-model="order.square">
					</div>

					<div class="form-group">
						<label for="address" class="control-label">订单地址</label>
						<div class="row">
							<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
								<select ng-model='datas.province' name='province' ng-options="city as city.name for city in cities" required class="form-control">
										<option value="" selected="true" disabled="true">请选择省</option>
								</select>
							</div>
							<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
								<select ng-model='datas.city' name='city' ng-options="city as city.name for city in datas.province.city" required class="form-control">
										<option value="" selected="true" disabled="true">请选择市</option>
								</select>
							</div>
							<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
								<select ng-model='datas.area' name='area' ng-options="city for city in datas.city.area" required class="form-control">
										<option value="" selected="true" disabled="true">请选择区</option>
								</select>
							</div>
						</div>
					</div>

					<div class="form-group">
						<label for="street" class="control-label">详细地址</label>
						<input type="text" class="form-control" id="street" placeholder="请输入详细地址" ng-model="order.street">
					</div>

					<div class="form-group" ng-if="handleLists.amount_roles.indexOf(user.user_type) != -1">
						<label for="total" class="control-label">安装费用</label>
						<input type="text" class="form-control" id="total123" input-format ng-pattern="/^\d+(\.\d{0,2})?$/" autocomplete="false" placeholder="请输入订单费用" ng-model="order.total">
					</div>

					<div class="form-group" ng-if="user.user_type == 'commission'">
						<label for="total" class="control-label">销售员提成金额(元)</label>
						<input type="text" class="form-control" id="sale_commission" input-format ng-pattern="/^\d+(\.\d{0,2})?$/" autocomplete="false" placeholder="请输入销售员提成金额" ng-model="order.sale_commission">
					</div>

					<div class="form-group" ng-if="user.user_type == 'commission'">
						<label for="total" class="control-label">介绍人提成金额(元)</label>
						<input type="text" class="form-control" id="intro_commission" input-format ng-pattern="/^\d+(\.\d{0,2})?$/" autocomplete="false" placeholder="请输入介绍人提成金额" ng-model="order.intro_commission">
					</div>

					<div ng-show="handleLists.amount_roles.indexOf(user.user_type) != -1">
						<div class="form-group">
							<label for="measure_amount" class="control-label">测量费用</label>
							<input type="text" class="form-control" id="measure_amount" input-format ng-pattern="/^\d+(\.\d{0,2})?$/" autocomplete="false" placeholder="请输入订单测量费用"
							 ng-model="order.measure_amount">
						</div>

						<div class="form-group">
							<label for="" class="pull-right control-label">订单总计：<span class="money">{{ order.total | moneyint }}元</span></label>
							<div ng-if="handleLists.amount_roles.indexOf(user.user_type) != -1">
								<label for="height" class="control-label">添加其他费用（无费用可不填写）</label>
								<div class="input-group" ng-repeat="(key, arr) in arrs track by key">
									<span class="input-group-addon">{{ key + 1 }}</span>
									<input type="text" ng-model="incidental[arr.remark].title" class="form-control input-group-addon-input" style="width:60%;"
									 placeholder="项目（支出缘由）">
									<input type="text" ng-model="incidental[arr.remark].price" class="form-control input-group-addon-input" style="width:40%;"
									 placeholder="金额（元）">
									<span class="input-group-addon" ng-click="delete(key)" ng-if="key != 0"><i class="icon-delete"></i></span>
								</div>
							</div>
						</div>

						<div class="form-group">
							<img src="components/mine/orders/orderdetail/imgs/add.png" alt="" ng-click="add();">
						</div>
					</div>
					<div class="form-group">
						<button type="submit" class="yf-shadow btn btn-default" ng-disabled="firstUpdate" ng-click="putOrder(order);">保存修改</button>
					</div>
				</form>
			</div>
		</div>
	</div>
</section>